<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">

    <title>Sổ QũyNT</title>


    <link rel="stylesheet" type="text/css" href="{$baseUrl}/media/css/jquery.dataTables.css">
    <link rel="stylesheet" type="text/css" href="{$baseUrl}/css/dataTables.tableTools.css">
    <link rel="stylesheet" type="text/css" href="{$baseUrl}/resources/syntax/shCore.css">
    <link rel="stylesheet" type="text/css" href="{$baseUrl}/resources/demo.css">
    <link rel="stylesheet" type="text/css" href="{$baseUrl}/styles/report.css">
    <link rel="stylesheet" type="text/css" class="init">

    <script type="text/javascript" language="javascript" src="{$baseUrl}/media/js/jquery.js"></script>
    <script type="text/javascript" language="javascript" src="{$baseUrl}/media/js/jquery.dataTables.js"></script>
    <script type="text/javascript" language="javascript" src="{$baseUrl}/js/dataTables.tableTools.js"></script>
    <script type="text/javascript" language="javascript" src="{$baseUrl}/resources/syntax/shCore.js"></script>
    <script type="text/javascript" language="javascript" src="{$baseUrl}/resources/demo.js"></script>

    <script type="text/javascript" language="javascript" class="init">
        {literal}
        $(document).ready(function() {
            $('#example').DataTable( {
                dom: 'T<"clear">lfrtip',
                tableTools: {
                    "sSwfPath": "http://duoc3.ovn.vn/swf/copy_csv_xls_pdf.swf"
                }
            } );
        } );
        {/literal}
    </script>

    <style type="text/css">
        {literal}
        /* this is an intersting idea for this section */
        .example-print {
            display: none;
        }
        @media print {
            .example-screen {
                display: none;
            }
            .example-print {
                display: block;
            }
            thead {
                display:table-header-group;
            }
            tbody {
                display:table-row-group;
            }
            tr {page-break-inside: avoid;}
        }
        {/literal}
    </style>


</head>

<body class="dt-example">
<br>
<div class="container">
    <section>
        <div>
            <div>
                <b>{$tencty}</b>
                <br>
                <i>{$diachi}</i>
            </div>
            <p>{$tieude}</p>
            <div class="detail">
                <b>Tài khoản: {$loaitk}-{$tentk}</b>
                <br>
                Từ ngày: <b>{$tbdau|date_format:"%d/%m/%Y"}</b> đến ngày: <b>{$tkthuc|date_format:"%d/%m/%Y"}</b>
            </div>

        </div>
        <div class="example-print" style = "line-height: 200%;">
            <div>
                <b>{$tencty}</b>
                <br>
                <i>{$diachi}</i>
            </div>
            <p style = "line-height: 200%;">{$tieude}</p>
            <div class="detail" style = "line-height: 200%;">
                <b>Tài khoản: {$loaitk}</b>
                <br>
                Từ ngày: <b>{$tbdau|date_format:"%d/%m/%Y"}</b> đến ngày: <b>{$tkthuc|date_format:"%d/%m/%Y"}</b>
            </div>

        </div>

        <table id="example" class="display" cellspacing="0" width="100%">

            <thead>
            <tr>
                <th  rowspan="2"> NGÀY </th>
                <th  colspan="2"> SỐ PHIẾU </th>
                <th  rowspan="2"> NỘI DUNG </th>
                <th  rowspan="2"> TKĐƯ </th>
                <th  colspan="2"> NỢ</th>
		<th  colspan="2"> CÓ</th>
            </tr>
            <tr>
                <th > THU </th>
                <th > CHI </th>
                <th > {$mant} </th>
                <th > Quy ra VNĐ </th>
                <th > {$mant} </th>
                <th > Quy ra VNĐ </th>

            </tr>

            </thead>

            <tfoot>
            <tr>

            </tr>
            </tfoot>

            <tbody>
                    <tr>
                    <td >
                     </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td id="noidung">
                        <b><i>Số dư đầu kỳ</b></i>
                    </td>
                    <td>
                    </td>
                    <td id="sotien">
		            <b>{$daukynt|number_format:2:",":"."}</b>
                    </td>
                    <td id="sotien" >
		            <b>{$dauky|number_format:0:".":"."}</b>
                    </td>
		    <td id="sotien" >
                    </td>
		    <td id="sotien" >
                    </td>

                </tr>

		{assign var="sodu" value=$dauky}
		{assign var="sodunt" value=$daukynt}
		{assign var="spsno" value=0}
		{assign var="spsco" value=0}
		{assign var="spsnont" value=0}
		{assign var="spscont" value=0}

	    {iterate from=ctkts item=ctkt name=ctkts}
               <tr>
		{if $ctkt->getnoco() eq 'N'}
		{assign var="sodu" value=$ctkt->getsoduN($sodu)}
		{assign var="spsno" value=$ctkt->getsps($spsno)}
		{assign var="sodu" value=$ctkt->getsoduN($sodu)}
		{assign var="spsno" value=$ctkt->getsps($spsno)}
		<td >
  		   {$ctkt->getngct()|date_format:"%d/%m/%Y"|escape}
		    </td>
		    <td>
			    {$ctkt->getsoct()|escape}
		    </td>
		    <td>
		    </td>
		    <td id="noidung">
			{$ctkt->getdiengiai()|escape}
		    </td>
		    <td>
			{$ctkt->gettkdu()|escape}
		    </td>


                    <td id="sotien">
                            {$ctkt->getsotiennt()|number_format:2:",":"."}
                    </td>

		    <td id="sotien">
                            {$ctkt->getsotienvn()|number_format:0:".":"."}
                    </td>
                    <td id="sotien" >
                    </td>

                    <td id="sotien" >
                    </td>
                
		{/if}
		</tr>
            {/iterate}

	     <tr>
                     <td style= "display:none">
                     </td>
		    <td></td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td id="noidung">
                        <b><i>Tổng phát sinh</b></i>
                    </td>
                    <td>
                    </td>
                    <td id="sotien">
                            <b>{$cuoiky.psnont|number_format:2:",":"."}</b>
                    </td>

                    <td id="sotien">
                            <b>{$cuoiky.psno|number_format:0:".":"."}</b>
                    </td>
		    <td id="sotien" >
                            <b>{$cuoiky.pscont|number_format:2:",":"."}</b>
                    </td>
		    
                    <td id="sotien" >
                            <b>{$cuoiky.psco|number_format:0:".":"."}</b>
                    </td>
                </tr>
	     <tr>
		 <td style= "display:none">
		    <label >{$cuoiky.ngayct}</label>
		    {$cuoiky.ngct|date_format:"%d/%m/%Y"}
                     </td>		    <td></td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td id="noidung">
                        <b><i>Số dư cuối kỳ</b></i>
                    </td>
                    <td>
                    </td>
                    <td id="sotien">
                            <b>{$cuoiky.sodunt|number_format:2:",":"."}</b>
                    </td>

                    <td id="sotien">
                            <b>{$cuoiky.sodu|number_format:0:".":"."}</b>
                    </td>
		    <td id="sotien" >

                    </td>
		    
                    <td id="sotien" >
                    </td>
                </tr>

           </tbody>
        </table>
        <br>
</body>
</html>